"use strict";

const Service = require('egg').Service;

class TestDBService extends Service{
    async addMysql(params){
        try {
            const app = this.app
            const res = app.mysql.insert('mygirl',params)
            return res
        } catch (error) {
            console.log(error);
            return null
        }
    }
    async delMysql(id){
        try{
            const app = this.app
            const res = app.mysql.delete('mygirl',id)
            return res
        }catch(error){
            console.log(error);
            return null
        }
    }
    async editorMysql(params){
        try {
            const app = this.app
            const res = app.mysql.update('mygirl',params)
            return res
        } catch (error) {
            console.log(error);
            return null
        }
    }
    async showMysql(){
        try{
            const app =this.app;
            const res = await app.mysql.select('mygirl')
            return res;
        }catch(error){
            console.log(error)
            return null;
        }
    }
}
module.exports = TestDBService